package com.ww.springboot.boot.game;

import java.util.Scanner;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-04-24 14:41
 */
public class 金字塔 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Integer n = sc.nextInt();

        Integer index = 1;
        for (int i = 1; i <= n; i++) {
            String sb = "";
            for (int k = i; k <= n - 1; k++) {
                sb += "    ";
            }
            String sb2 = "";
            int j = 1;
            while (j <= i) {
                if (i % 2 == 0) {
                    sb2 = addStar(index) + sb2;
                    if (j < i) {
                        sb2 = "    " + sb2;
                    }
                } else {
                    sb2 += addStar(index);
                    if (j < i) {
                        sb2 += "    ";
                    }
                }
                j++;
                index++;
            }
            System.out.println(sb + sb2);
        }
    }

    private static String addStar(int j) {
        String ss = j + "";
        if (j < 10) {
            ss += "***";
        } else if (j < 100) {
            ss += "**";
        } else if (j < 1000) {
            ss += "*";
        }
        return ss;
    }
}
